package com.github.kennylee26.javaee.mvc.entity;

import com.fasterxml.jackson.annotation.JsonView;

import java.util.Date;
import java.util.List;

/**
 * <b>类名称：</b>User<br/>
 * <b>类描述：</b>  <br/>
 * <b>备注：</b><br/>
 *
 * @author kennylee <br />
 * @version 1.0.0 <br/>
 */
public class User {

    public interface WithoutPasswordView {
    }

    public interface WithPasswordView extends WithoutPasswordView {
    }

    private String name;
    private String password;
    private List<String> departments;
    private Date createTime;
    private String avatarPath;

    private Role role;
    private String comment;

    @JsonView(WithoutPasswordView.class)
    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    @JsonView(WithoutPasswordView.class)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @JsonView(WithPasswordView.class)
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @JsonView(WithoutPasswordView.class)
    public List<String> getDepartments() {
        return departments;
    }

    public void setDepartments(List<String> departments) {
        this.departments = departments;
    }

    @JsonView(WithoutPasswordView.class)
    public String getComment() {
        return comment;
    }

    @JsonView(WithoutPasswordView.class)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getAvatarPath() {
        return avatarPath;
    }

    public void setAvatarPath(String avatarPath) {
        this.avatarPath = avatarPath;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", createTime=" + createTime +
                ", avatarPath='" + avatarPath + '\'' +
                ", comment='" + comment + '\'' +
                '}';
    }
}
